package com.softservecom.training.shop.pojos;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * ProductsCategories entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "ProductsCategories", schema = "dbo", catalog = "Java")
public class ProductsCategories implements java.io.Serializable {

	// Fields

	private Integer productsCategoryId;
	private String groupName;
	private Integer raiting;
	private Set<Products> productses = new HashSet<Products>(0);

	// Constructors

	/** default constructor */
	public ProductsCategories() {
	}

	/** minimal constructor */
	public ProductsCategories(Integer productsCategoryId, Integer raiting) {
		this.productsCategoryId = productsCategoryId;
		this.raiting = raiting;
	}

	/** full constructor */
	public ProductsCategories(Integer productsCategoryId, String groupName,
			Integer raiting, Set<Products> productses) {
		this.productsCategoryId = productsCategoryId;
		this.groupName = groupName;
		this.raiting = raiting;
		this.productses = productses;
	}

	// Property accessors
	@Id
	@Column(name = "ProductsCategoryID", unique = true, nullable = false)
	public Integer getProductsCategoryId() {
		return this.productsCategoryId;
	}

	public void setProductsCategoryId(Integer productsCategoryId) {
		this.productsCategoryId = productsCategoryId;
	}

	@Column(name = "GroupName", length = 50)
	public String getGroupName() {
		return this.groupName;
	}

	public void setGroupName(String groupName) {
		this.groupName = groupName;
	}

	@Column(name = "Raiting", nullable = false)
	public Integer getRaiting() {
		return this.raiting;
	}

	public void setRaiting(Integer raiting) {
		this.raiting = raiting;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "productsCategories")
	public Set<Products> getProductses() {
		return this.productses;
	}

	public void setProductses(Set<Products> productses) {
		this.productses = productses;
	}

}